package com.ryl.yomall.weball.controller;

import com.ryl.yomall.model.order.OrderInfo;
import com.ryl.yomall.order.client.OrderFeignClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

/**
 * @Date 20:35
 * @Author ryl
 */
@Controller
public class PayController {
    @Autowired
    private OrderFeignClient orderFeignClient;
    @GetMapping("/pay.html")
    public String pay(Long orderId,Model model){
        OrderInfo orderInfo = orderFeignClient.getOrderInfo ( orderId );
        model.addAttribute ( "orderInfo",orderInfo );

        return "payment/pay";
    }
    //支付成功之后转发 成功页岩
    @GetMapping("/pay/success.html")
    public String success(){
        return "payment/success";
    }
}
